import React from "react";
import MyContext from "../contexts/MyContext";
import Counter from "../contexts/Counter";

class Button extends React.Component {
  render(): React.ReactNode {
    return (
      <MyContext.Consumer>
        {(value) => (
          <Counter.Consumer>
            {(obj) => (
              <button onClick={obj.increment}>
                Button - {value} - {obj.value}
              </button>
            )}
          </Counter.Consumer>
        )}
      </MyContext.Consumer>
    );
  }
}
export default Button;
